<?php
    $str='';
    $dir='/Project/law_and_partners/themes/kcms_edit/images/flags';
    $files = glob($dir.'/*.{png}', GLOB_BRACE);
    foreach($files as $i=>$file) {
        $file_name_full=end(explode("/", $file));
        $file_name=explode(".", $file_name_full);
        $file_name=$file_name[0];
        $y=-($i*16);
        $str.="#_lang_$file_name
        {
        background: transparent url(../images/flags.png)  0 ".$y."px no-repeat;
        }
        "; 
    }
    echo $str;

?>
